package cn.xuetian.mqtest.listener;

import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

@Slf4j
@Component
public class MqListener {


    @Value("${demo.mymqTest.exchange}")
    private String exchange;

    @Value("${demo.mymqTest.queue}")
    private String queue;

    @Value("${demo.mymqTest.routing}")
    private String routing;

    @RabbitListener(queues = "devHostTopicQueue1")
    public void test(String message) {

        System.out.println("listener message = " + message);

        log.info(String.format("message接收：%s\n", message));

    }

}
